﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Farming.Repositories
{
    public interface IRepository<T> where T:class
    {
        Task<int> InSertAsync(T e);
        Task<int> InsertAsync(List<T> e);
        Task<int> DeleteAsync(int id);
        Task<int> DeleteAsync(Expression<Func<T, bool>> expression);
        Task<T> GetByIdAsync(int id);
        Task<List<T>>GetAllAsync();
        Task<int> UpdateAsync(T entity);
        Task<int> UpdateAsync(List<T> entity);
        Task<T> FindAsync(Expression<Func<T, bool>> expression);
        Task<List<T>> GetAllByEx(Expression<Func<T,bool>> ex);
    }
}
